﻿using System;
using UnityEngine;

namespace FBSAssist
{
	// Token: 0x02000589 RID: 1417
	public class TimeProgressCtrl
	{
		// Token: 0x060021F5 RID: 8693 RVA: 0x00134CA4 File Offset: 0x00132EA4
		public TimeProgressCtrl(float ptime = 0.15f)
		{
			this.progressTime = ptime;
		}

		// Token: 0x060021F6 RID: 8694 RVA: 0x00134CCC File Offset: 0x00132ECC
		public virtual void End()
		{
			this.count = this.progressTime;
			this.rate = 1f;
		}

		// Token: 0x060021F7 RID: 8695 RVA: 0x00134CE8 File Offset: 0x00132EE8
		public virtual void Start()
		{
			this.count = 0f;
			this.rate = 0f;
		}

		// Token: 0x060021F8 RID: 8696 RVA: 0x00134D00 File Offset: 0x00132F00
		public virtual float Calculate()
		{
			this.count += Time.deltaTime;
			if (this.count < this.progressTime)
			{
				this.rate = Mathf.InverseLerp(0f, this.progressTime, this.count);
			}
			else
			{
				this.End();
			}
			return this.rate;
		}

		// Token: 0x060021F9 RID: 8697 RVA: 0x00134D60 File Offset: 0x00132F60
		public virtual void SetProgressTime(float time)
		{
			this.progressTime = time;
		}

		// Token: 0x060021FA RID: 8698 RVA: 0x00134D6C File Offset: 0x00132F6C
		public virtual float GetProgressRate()
		{
			return this.rate;
		}

		// Token: 0x04002A71 RID: 10865
		protected float count;

		// Token: 0x04002A72 RID: 10866
		protected float rate = 1f;

		// Token: 0x04002A73 RID: 10867
		protected float progressTime = 0.15f;
	}
}
